// **************************************************************
// Com ++ Framework by the C++ World
// Please report defects: mailto:compp@cplusplusworld.com
// Please visit: http://www.cplusplusworld.com/socketlibrary.html
// **************************************************************

#include <iostream>
#include <cstdlib>
#include "ComPlusPlus/ComPlusPlus"

#include <string>

int main (int argc, char *argv [] ) {
try {	

  compp::Launch *C1 = new compp::Launch ( "/bin/ls  -l" ) ;

  if ( C1 == NULL ) {
    std::cout << "Spawn == NULL\n";
  }
  std::cout << "SPAWNING1\n";
  C1->Spawn();

  for ( int i = 0; i < 20; ++i ) {
    syspp::Call::Sleep(1);
    std::cout << "**Parent \n";
  }
  delete C1;

 } catch ( syspp::ComException &e ) {
  std::cout <<  "Exception " << e.what() << "\n" ;	

} catch ( ... ) {
	std::cout <<  "Gen Exception\n" ;	
}

 return 0;	
}
